package mytest.tx;




public class Test {

	/**
	 * 反转单词
	 * @param input
	 */
	static void solve(char input[])
	{
		char tmp;
		for(int i=0,j=input.length-1;i<j;i++,j--)
		{
			tmp=input[i];
			input[i]=input[j];
			input[j]=tmp;
		}
		int j=0;
		for(int i=0;i<input.length;i++)
		{
			if(input[i]==' ')
			{
				for(int p=j,q=i-1;p<q;p++,q--)
				{
					tmp=input[p];
					input[p]=input[q];
					input[q]=tmp;
				}
				j=i+1;
			}
		}
		
		for(int p=j,q=input.length-1;p<q;p++,q--)
		{
			tmp=input[p];
			input[p]=input[q];
			input[q]=tmp;
		}
		
		System.out.println(String.valueOf(input));
	}
	
	
	
	
	
	
	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub

		int type=5;
		switch(type)
		{
		default:System.out.println(type);
		case 1:System.out.println(1);
		case 2:System.out.println(2);
		case 3:System.out.println(3);
		}
		
//		A.getInstance();
//		A.getInstance();
//		A.getInstance();
//		A.getInstance();
		
//		
//		try {
//			throw new Exception("1");
//		}
//		catch(Exception e)
//		{
//			throw new Exception("2");
//		}
//		catch(Throwable t)
//		{
//			throw new Exception("3");
//		}finally {
//			System.out.println(1);
//			throw new Exception("4");
//		}
		
		System.out.println(Integer.MAX_VALUE+1);
		
		
		solve("what are you doing h".toCharArray());
	}

}

class A{
	private static A instance=new A();
	private static int count=1;
	private A()
	{
		System.out.println(count);
	}
	public static A getInstance()
	{
		return instance;
	}
}
